package com.efrei.uchat.tests;

import com.efrei.uchat.exception.UChatException;
import com.efrei.uchat.message.TextMessage;

public class TextMessageTest {

	private static void test(
			String text, String croom,
			int authorId, String author,
			int sessionId) {
		System.out.println("\n");
		System.out.println("TEST '''"+text+"'''");
		
		TextMessage msg = new TextMessage(text, croom, authorId, author, sessionId);
		System.out.println("toString: "+msg.toString());
		System.out.println("getText: '''"+msg.getText()+"'''");
		System.out.println("type: "+msg.getType().getText());
	}
	
	public static void main(String[] args) throws UChatException {
		test("mon text lol", "public", 0, "me", 0);
		test("mon text lol\nnewline ok", "public", 0, "me", 0);
		test("mon text# lol\n#newline ok#", "public", 2, "me", 1);
	}
}
